#!/bin/bash

case $1 in
    start) 
	 uwsgi --ini uwsgi.ini
         sleep 3
         echo "pid:$(< uwsgi.pid)"
         ;;
    stop) 
	 echo "pid:$(< uwsgi.pid)"
         uwsgi --stop uwsgi.pid
         ;;
    status) 
	 uwsgi --connect-and-read uwsgi.status
         echo ''
         ;;
    restart) 
	 echo "pid:$(< uwsgi.pid)"
         uwsgi --reload uwsgi.pid
         echo "pid:$(< uwsgi.pid)"
         ;;
     *)  echo "require start|stop|status|restart"  ;;
esac
